<?php
    /**
     * To Implement Custom Exceptions from this template; you can use class [NameOfException] extends Exception {}
	 * @package fwork
	 * @subpackage utilities
     */

	 /**
	  * 
	  */

	 /**
	  * Definitions for Classes
	  */
	  $defC = 1;
	define('EXCEP_TESTINGEXCEPTION', -1);
	define('EXCEP_SQLCONNECTFAILURE', $defC++);
	define('EXCEP_DEPENDENCYNOTSATISFIED', $defC++);
	define('EXCEP_INVALIDUSEOFSINGLETON', $defC++);
	define('EXCEP_GTFO', $defC++);
	define('EXCEP_SECURITY', $defC++);
	define('EXCEP_INVALIDTYPE', $defC++);
	define('EXCEP_PRODSERV_SLAVE_ADDEXCEPTION', $defC++);
	define('EXCEP_GO_FISH_EXCEPTION', $defC++);
	define('EXCEP_OPENID_EXCEPTION', $defC++);
	$defC = null; unset($defC);

// ------ Testing Exception Class ----- //
	/**
	 * Testing Exception class for use in debugging
	 * @package fwork
	 * @subpackage utilities
	 * @author Anthony Free
	 * @version 20110929
	 */
class TestingException extends Exception {
	/**
	 * Constructor for the class
	 * @param String $message
	 */
    public function __construct($message = null) {
        parent::__construct("TestingException: ".$message, EXCEP_TESTINGEXCEPTION);
    }
}

// ------ Implemented Custom Exceptions ----- //
	/**
	 * SQL Connection Failure Exception
	 * @package fwork
	 * @subpackage utilities
	 * @author Anthony Free
	 * @version 20110501
	 */
class SQLConnectFailureException extends Exception {
    /**
	 * Constructor for the Class
	 * @param String $message 
	 */
	public function __construct($message = null) {
        parent::__construct("SQLConnectFailureException: ".$message, EXCEP_SQLCONNECTFAILURE);
    }
}
	/**
	 * Dependency Not Satisfied Exception
	 * @package fwork
	 * @subpackage utilities
	 * @author Anthony Free
	 * @version 20110501
	 */
class DepencyNotSatisfiedException extends Exception {
	/**
	 * Constructor for the Class
	 * @param String $message 
	 */
    public function __construct($message = null) {
        parent::__construct("DepencyNotSatisfiedException: ".$message, EXCEP_DEPENDENCYNOTSATISFIED);
    }
}
	/**
	 * @package fwork
	 * @subpackage utilities
	 * @author Anthony Free
	 * @version 20111002
	 */
class InvalidUseOfSingletonException extends Exception {
	/**
	 * Constructor for the Class
	 * @param String $message 
	 */
    public function __construct($message = null) {
        parent::__construct("InvalidUseOfSingletonException: ".$message, EXCEP_INVALIDUSEOFSINGLETON);
    }
}
	/**
	 * @package fwork
	 * @subpackage utilities
	 * @author Anthony Free
	 * @version 20111002
	 */
class GTFOException extends Exception {
	/**
	 * Constructor for the Class
	 * @param String $message 
	 */
    public function __construct($message = null) {
        parent::__construct("GTFOException: ".$message, EXCEP_GTFO);
    }
}
	/**
	 * @package fwork
	 * @subpackage utilities
	 * @author Anthony Free
	 * @version 20111005
	 */
class SecurityException extends Exception {
	/**
	 * Constructor for the Class
	 * @param String $message 
	 */
    public function __construct($message = null) {
        parent::__construct("SecurityException: ".$message, EXCEP_SECURITY);
    }
}
	/**
	 * @package fwork
	 * @subpackage utilities
	 * @author Anthony Free
	 * @version 20111005
	 */
class InvalidTypeException extends Exception {
	/**
	 * Constructor for the Class
	 * @param String $message 
	 */
    public function __construct($message = null) {
        parent::__construct("SecurityException: ".$message, EXCEP_INVALIDTYPE);
    }
}

/**
 * @package fwork
 * @subpackage utilities
 * @author Anthony Free
 * @version 20111111
 */
class GoFishException extends Exception {
	/**
	 * Constructor for the class
	 * @param String $message
	 */
	public function __construct($message = null) {
		parent::__construct("GoFishException: $message", EXCEP_GO_FISH_EXCEPTION);
	}
}

/**
 * @package fwork
 * @subpackage utilities
 * @author Anthony Free
 * @version 20120215
 */
class OpenIDException extends Exception {
	/**
	 * Constructor for the class
	 * @param String $message
	 */
	public function __construct($message = null) {
		parent::__construct("OpenIDException: $message", EXCEP_OPENID_EXCEPTION);
	}
}
?>